from openpyxl import load_workbook,Workbook
import os

class Do_Excel:
    def __init__(self,filename,sheetname='Sheet1'):
        self.filename=filename
        self.sheetname=sheetname

    def write(self,i,j,value):
        if not os.path.exists(self.filename):
            wb = Workbook()
            sh = wb.create_sheet(self.sheetname)
        else:
            wb = load_workbook(self.filename)
            sh = wb[self.sheetname]
        sh.cell(i,j).value=value
        wb.save(self.filename)

Do_Excel('erverv.xlsx').write(1,1,'sdcds')
Do_Excel('erverv.xlsx').write(1,2,'change')
Do_Excel('erverv.xlsx').write(3,2,'pass')
